package com.jsnj33.pdaproject.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jsnj33.pdaproject.R;
import com.jsnj33.pdaproject.bean.PayingBillsBean;

import java.util.List;

public abstract class TranslateAdapter extends RecyclerView.Adapter<TranslateAdapter.ViewHolder> {

    private Context mContext;

    private List<PayingBillsBean.TfBean> list;

    public TranslateAdapter(Context context) {
        this.mContext = context;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_translate, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, final int position) {
    }

    @Override
    public int getItemCount() {
        return list != null ? list.size() : 0;
    }

    protected abstract void setNumber(int position);

    public void setList(List<PayingBillsBean.TfBean> list) {
        this.list = list;
        notifyDataSetChanged();
    }

    class ViewHolder extends RecyclerView.ViewHolder {

        private TextView tv_zc_no;
        private TextView tv_zc_name;


        ViewHolder(View itemView) {
            super(itemView);
            tv_zc_no = itemView.findViewById(R.id.tv_zc_no);
            tv_zc_name = itemView.findViewById(R.id.tv_zc_name);
        }
    }
}
